The Construction and Computation of for-loop Programs for SCMPDS
نویسندگان
چکیده
This article defines two for-loop statements for SCMPDS. One is called for-up, which corresponds to ”for (i=x; i<0; i+=n) S” in C language. Another is called for-down, which corresponds to ”for (i=x; i>0; i-=n) S”. Here, we do not present their unconditional halting (called parahalting) property, because we have not found that there exists a useful for-loop statement with unconditional halting, and the proof of unconditional halting is much simpler than that of conditional halting. It is hard to formalize all halting conditions, but some cases can be formalized. We choose loop invariants as halting conditions to prove halting problem of for-up/down statements. When some variables (except the loop control variable) keep undestroyed on a set for the loop invariant, and the loop body is halting for this condition, the corresponding for-up/down is halting and computable under this condition. The computation of for-loop statements can be realized by evaluating its body. At the end of the article, we verify for-down statements by two examples for summing.
منابع مشابه
The Construction and Computation of While-Loop Programs for SCMPDS
This article defines two while-loop statements on SCMPDS, i.e. “while<0” and “while>0”, which resemble the while-statements of the common high language such as C. We previously presented a number of tricks for computing while-loop statements on SCMFSA, e.g. step-while. However, after inspecting a few realistic examples, we found that they are neither very useful nor of generalization. To cover ...
متن کاملThe Construction and Computation of While-Loop Programs for SCMPDS1
This article defines two while-loop statements on SCMPDS, i.e. “while<0” and “while>0”, which resemble the while-statements of the common high language such as C. We previously presented a number of tricks for computing while-loop statements on SCMFSA, e.g. step-while. However, after inspecting a few realistic examples, we found that they are neither very useful nor of generalization. To cover ...
متن کاملThe Construction and Computation of for-loop Programs for SCMPDS1
This article defines two for-loop statements for SCMPDS. One is called for-up, which corresponds to “for (i=x; i<0; i+=n) S” in C language. Another is called fordown, which corresponds to “for (i=x; i>0; i-=n) S”. Here, we do not present their unconditional halting (called parahalting) property, because we have not found that there exists a useful for-loop statement with unconditional halting, ...
متن کاملInsert Sort on Scmpds
The goal of this article is to examine the effectiveness of “forloop” and “while-loop” statements on SCMPDS by insert sort. In this article, first of all, we present an approach to compute the execution result of “for-loop” program by “loop-invariant”, based on Hoare’s axioms for program verification. Secondly, we extend the fundamental properties of the finite sequence and complex instructions...
متن کاملInsert Sort on SCMPDS 1
The goal of this article is to examine the effectiveness of “for-loop” and “while-loop” statements on SCMPDS by insert sort. In this article, first of all, we present an approach to compute the execution result of “for-loop” program by “loop-invariant”, based on Hoare’s axioms for program verification. Secondly, we extend the fundamental properties of the finite sequence and complex instruction...
متن کامل